<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="<?=base_url('publics/admin');?>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url('publics/admin');?>/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url('publics/admin');?>/lib/font-awesome/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link href="<?=base_url('publics/admin');?>/lib/font-awesome/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
<![endif]-->
<link href="<?=base_url('publics/admin');?>/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>用户管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="iconfont">&#xf012b;</i> 首页 <span class="c-gray en">&gt;</span> 权限管理 <span class="c-gray en">&gt;</span> 菜单管理 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="icon-refresh"></i></a></nav>
<div class="pd-20">
  <div class="text-c"> 日期范围：
    <input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}'})" id="datemin" class="input-text Wdate" style="width:120px;">
    -
    <input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d'})" id="datemax" class="input-text Wdate" style="width:120px;">
    <input type="text" class="input-text" style="width:250px" placeholder="输入会员名称、电话、邮箱" id="" name=""><button type="submit" class="btn btn-success" id="" name=""><i class="icon-search"></i> 搜用户</button>
  </div>
  <div class="cl pd-5 bg-1 bk-gray mt-20">
  	<span class="l">
  	    <a href="<?=base_url('manage/user/insert');?>" class="btn btn-primary radius"><i class="icon-plus"></i>添加用户</a>
  	</span>
  </div>
     <table class="table table-border table-bordered table-hover table-bg">
      <thead>
        <tr class="text-c">
          	<th  width="80">用户ID</th>
			<th width="200">用户名</th>
			<th width="200">用户昵称</th>
			<th width="200">所属角色</th>
			<th width="300">登录IP</th>
			<th width="300">登录时间</th>
			<th>操作</th>
        </tr>
      </thead>
      <tbody> 
	    <?php if(!empty($error)):?>
          	<tr  class="text-c">
            	<td colspan="8" align="center"><?=$error;?></td>
            </tr>
        <?php else:?>
          	<?php foreach($user_arr as $val):?>
		   	<tr class="text-c">
		   		<td><?=$val['user_id'];?></td>
		   		<td><?=$val['user_name'];?></td>
				<td><?=$val['user_nickname'];?></td>
				<td><?=$val['role_name'];?></td>
				<td><?=$val['user_login_ip'];?>&nbsp;</td>
				<td><?=$val['user_login_time'];?>&nbsp;</td>
				<td>
					<a title="编辑" href="<?=base_url('manage/user');?>/edit?u_id=<?=$val['user_id'];?>" class="ml-5" style="text-decoration:none"><i class="icon-edit"></i></a>
					|
				    <a title="删除" href="javascript:;"  onclick="return delmenu(<?=$val['user_id'];?>);" class="ml-5" style="text-decoration:none"><i class="icon-trash"></i></a>
				</td>
		   	</tr>
			<?php endforeach;?>
        <?php endif;?>
      </tbody>
    </table>
</div>
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/jquery.min.js"></script> 
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/layer1.8/layer.min.js"></script> 
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/laypage/laypage.js"></script> 
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="<?=base_url('publics/admin');?>/lib/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="<?=base_url('publics/admin');?>/js/H-ui.js"></script>  
<script type="text/javascript" src="<?=base_url('publics/admin');?>/js/H-ui.admin.js"></script>
<script type="text/javascript" src="<?=base_url('publics/admin');?>/js/H-ui.admin.doc.js"></script>
<script type="text/javascript">
$('.table-sort').dataTable({
	"lengthMenu":false,//显示数量选择 
	"bFilter": false,//过滤功能
	"bPaginate": false,//翻页信息
	"bInfo": false,//数量信息
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	  {"orderable":false,"aTargets":[0,8,9]}// 制定列不参与排序
	]
});

// 询问框
function delmenu(id){
	$.layer({
	    shade: [0],
	    area: ['auto','auto'],
	    dialog: {
	        msg: '确定要删除该用户吗？',
	        btns: 2,                    
	        type: 4,
	        btn: ['是','否'],
	        yes: function(){
	            $.get("user/delete?uid="+id,function(res){
					if(res == 'ok'){
						layer.msg('删除成功!', 1, 1);
						location.reload();
					}else{
						layer.msg('删除失败!', 1, 3);
					}
				});
	        }, no: function(){}
	    }
	});
}
</script> 
</body>
</html>